from flask import Blueprint, jsonify, render_template


api_bp = Blueprint('page', __name__)
# 根路由
@api_bp.route('/')
def index():
    return render_template('index.html')
@api_bp.route('/student')
def student():
    return render_template('student.html')
@api_bp.route('/teacher')
def teacher():
    return render_template('teacher.html')
@api_bp.route('/course')
def course():
    return render_template('course.html')
@api_bp.route('/score')
def score():
    return render_template('score.html')
@api_bp.route('/class')
def clazz():
    return render_template('class.html')
@api_bp.route('/report')
def report():
    return render_template('report.html')
@api_bp.route('/setting')
def setting():
    return render_template('setting.html')
# 错误处理
@api_bp.errorhandler(404)
def not_found(error):
    return jsonify({"error": "未找到资源"}), 404
